Amend a constraint solver test
authorMatthias Clasen <mclasen@redhat.com>
Fri, 28 Jun 2019 16:30:07 +0000 (16:30 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Sun, 30 Jun 2019 23:10:11 +0000 (00:10 +0100)
Make the 'repeat edit' test make more than to
suggestions in a single edit phase. It turns out
that this does not work, whereas just doing
two in a row does.

testsuite/gtk/constraint-solver.c

index f09decbaa999445bb414cae6f7e07d7c7ff780f7..54fc39d1c329af8bf22f334d96d94f8c8514cb38 100644 (file)
@@ -254,15 +254,27 @@ constraint_solver_edit_var_suggest (void)
   gtk_constraint_solver_suggest_value (solver, a, 2.0);
   gtk_constraint_solver_resolve (solver);
 
+  g_test_message ("Check values after first edit");
+
   g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (a), 2.0, 0.001);
   g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (b), 2.0, 0.001);
 
   gtk_constraint_solver_suggest_value (solver, a, 10.0);
   gtk_constraint_solver_resolve (solver);
 
+  g_test_message ("Check values after second edit");
+
   g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (a), 10.0, 0.001);
   g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (b), 10.0, 0.001);
 
+  gtk_constraint_solver_suggest_value (solver, a, 12.0);
+  gtk_constraint_solver_resolve (solver);
+
+  g_test_message ("Check values after third edit");
+
+  g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (a), 12.0, 0.001);
+  g_assert_cmpfloat_with_epsilon (gtk_constraint_variable_get_value (b), 12.0, 0.001);
+
   gtk_constraint_variable_unref (a);
   gtk_constraint_variable_unref (b);